package com.csdj.game.util;

import org.springframework.util.DigestUtils;

/**
 * author:cloud
 * date:2021/3/30 0030
 **/
public class EncryptUtil {

    public static String getMd5(String msg){
        StringBuilder sb = new StringBuilder();
        byte[] bytes = DigestUtils.md5Digest(msg.getBytes());
        for(int i=0;i<bytes.length;i++){
            sb.append(String.format("%02x",bytes[i]));
        }
        return sb.toString();
    }


    public static void main(String[] args) {
        System.out.println(getMd5("123456"));
    }
}
